#ifndef _RENDERTARGET_H_
#define _RENDERTARGET_H_
#include <SERender/Resourses/Texture.h>
#include <unordered_map>
#include <string>
#include <memory>

namespace SEngine
{
    class RenderTargetManager
    {
    public:
        virtual ~RenderTargetManager() = default;
        void Clear() { m_renderTargets.clear(); }
        void AddTarget(const std::string & name, std::shared_ptr<Texture> target) { m_renderTargets.try_emplace(name, target); }
        bool RemoveTarget(const std::string & name) { return m_renderTargets.erase(name); }
        std::shared_ptr<Texture> GetTarget(const std::string & name) { return m_renderTargets.find(name) != m_renderTargets.end() ? m_renderTargets.at(name) : nullptr; }

    private:
        std::unordered_map<std::string, std::shared_ptr<Texture>> m_renderTargets;
    };
} // namespace SEngine


#endif